-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Output/Entry] Changes entries output
method to pretty_value
property
#147
base: master
Are you sure you want to change the base?
Conversation
Apologies for the mess of commits -- my Pylint VS Code integration was silently broken, I didn't have mypy installed, and I'm not totally familiar with type hinting in Python yet! |
I really need to fix Pylint 😉 Another thought: After (or even before...) this change, some of the
As these all essentially just change the way their value is formatted to a string. This just leaves the following entries with a custom
In fact, looking at the |
Hello Michael ! That's good work again 🙏 These changes are somewhat breaking regarding Some notes :
Bye, have a nice WE 👋 |
Hi!
I would hold off for now, it's very much a mess 😉 As for the custom type, I didn't know about that! As you say, it's cleaner -- I'll change it soon.
I thought something similar, but it's hard to come up with a name. We already have |
As we return somehow a list, maybe |
…erty. This is a "bit more OOP" and easier to understand. + Unrelated change: Fix stupid range test I added to `Colors` -- has been bugging me since I noticed it :)
Incl. changed tests where appropriate.
e860e35
to
d17dfc7
Compare
@HorlogeSkynet I was thinking about this for a while and I think you were right in overriding the magic methods to make an iterable. What do you think of this approach? In general a lot of entries have lines removed (simpler? 🤔), and the output handling is shifted more into To-do, still:
It might be a while before I get around to those, I've got exams next month! See you! |
Impressive work @ingrinder 😇
👍
Ignore this notification and spend more time on this when you'll want/be able to ! I planned a new release for around ~August this year. First review :
Bye ! 👋 |
I've got time spare to go over your comment :)
Since it grabs from Maybe this is not the right structure, and say a list of tuples would be more appropriate? (it would be a breaking change though, particularly for JSON output)
Ah, thanks! Definitely simpler that way.
You're right, this is a stub from while I was rewriting the other entries. I had a
Thanks for catching, will sort these next time I work on it 😄
The problem with that approach is that strings are iterable but we don't really want to iterate over them when the entry value consists of only a string, otherwise we will get an entry line per character! It made most sense to me at the time to set up an iterator where the sequence returned matches the lines of the entry. Other than that, I agree that it's probably a better solution to try
Yes, I don't see why not, e.g. changing the first test to Thanks for taking a look over it. I'll be back soon! 👋 |
Description
I mentioned this already in #146 - this approach is a "bit more OOP". I find it easier to reason about
output
getting the property directly from each entry than a callback (output.output
) calling a callback (entry.output
) calling a callback (output.append
)!!Reason and / or context
Partly cleaner, partly because it makes it easier to cache these properties for #146 😁
How has this been tested ?
Seems to work alright on my system, unit tests updated accordingly
Types of changes :
Bug fix (non-breaking change which fixes an issue)Entry.output
I don't think there's any end-user differenceNew feature (non-breaking change which adds functionality)Breaking change (fix or feature that would cause existing functionality to change)Checklist :
[IF NEEDED] I have updated the README.md file accordingly ;